package kneipe.personen;

import kneipe.Kneipe;
import kneipe.Seat;

public class Person<P>{
	private String name;
	private int money;
	private Kneipe kneipe;

	public Person() {
		this("MisterX", 0, null);
	}

	public Person(String name, int money, Kneipe kneipe) {
		setName(name);
		this.money = money;
		this.kneipe = kneipe;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return this.name;
	}

	public int getMoneyAmount() {
		return money;
	}

	public boolean enter(Kneipe kneipe) {
		return (kneipe.enter(this) != null);
	}

	public void leave() {
		this.kneipe.sayBye(this);
		this.kneipe = null;
	}

	public Kneipe getKneipe() {
		return kneipe;
	}

	public void setKneipe(Kneipe kneipe) {
		this.kneipe = kneipe;
	}

	@Override
	public String toString() {
		return this.name;
	}
	
	public Seat getSeat() {
		return null;
	}

}
